home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sounds Terrific 1
/
Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso
/
modules
/
e
/
edpromp2.mod
< prev
next >
Wrap
Text File
|
1994-08-04
|
7KB
|
169 lines
6EDPROM
Frank Reid #1 @9703
Tue Dec 03 19:25:41 1991
EDPROMP2.MOD - Upgrade to EDPROMPT - Change prompt strings from within BBS
by Untouchable #1 @9804
This is an upgrade to EDPROMPT. To install, you NEED EDPROMPT.MOD. This
makes a minor modification to MSGBASE.C to read the current message
number, and other than that, just replace the void readprompt() you have
with this one.
Go to the end of this mod for IMPORTANT notes.
In BBS.C, delete the void readprompt() you have, and add this block.
Remember to add the extern int.
extern int messagenumber;
void readprompt(char *string)
/* This routine reads a string, filters out the acceptable '@' commands,
and prints out the result. This can pretty much be used anywhere. */
{
int i;
char s[81];
for (i=0;i<strlen(string);i++) {
if (string[i]!='@')
outchr(string[i]);
else {
i++;
switch (string[i]) {
case 'S': /* subboard name */
outstr(subboards[usub[cursub].subnum].name);
break;
case 'D': /* directory name */
outstr(directories[udir[curdir].subnum].name);
break;
case 's': /* subboard number */
outstr(usub[cursub].keys);
break;
case 'd': /* directory number */
outstr(udir[curdir].keys);
break;
case 'u': /* time used (minutes) */
real_tl(0);
break;
case 'l': /* time left (minutes) */
real_tl(1);
break;
case 'n': /* user's name and number */
outstr(nam(&thisuser,usernum));
break;
case 'r': /* go to next line */
nl();
break;
case 'c': /* current baud rate */
outstr(curspeed);
break;
case 'x': /* ANSI escape character */
if (okansi())
outchr(27);
break;
case 'g': /* beep! control-G */
outchr(7);
break;
case 'A': /* user's SL */
itoa(thisuser.sl,s,10);
outstr(s);
break;
case 'a': /* user's DSL */
itoa(thisuser.dsl,s,10);
outstr(s);
break;
case 't': /* user's gold */
itoa(thisuser.gold,s,10);
outstr(s);
break;
case 'M': /* current message number */
itoa(messagenumber,s,10);
outstr(s);
break;
case 'm': /* number of messages in sub */
itoa(nummsgs,s,10);
outstr(s);
break;
case 'f': /* upload to download ratio */
sprintf(s,"%-6.3f",ratio());
outstr(s);
break;
case 'p': /* post to call ratio */
sprintf(s,"%-6.3f",
(double)thisuser.msgpost/(double)thisuser.logons);
outstr(s);
break;
default : /* anything else */
outchr('@');
break;
}
}
}
}
Now load MSGBASE.C and after the extern voids, add this line:
int messagenumber;
Now skip down to void read_message, and make the following change in the
beginning.
messagenumber=n; /* add this */
abort=0; /* existing */
*next=0; /* existing */
Now you're done - you may wish to make a list of all the commands and have
it print out before you edit - a little too much to remember now.
IMPORTANT NOTES.
If you want to make the size of the prompts bigger, you MUST do so when
you FIRST install the mod, otherwise STATUS.DAT will crash. Keep in mind
that each byte you add to it, adds to DGROUP, so making mainprompt[81]
mainprompt[101], you've just added 20 bytes of DGROUP. REMEMBER : you
must also change void editgiven so that you can still input beyond 80
characters - otherwise the increased size won't do any good.
Adding prompts is incredibly easy. Currently, I have 11 prompt strings
that are read through this. Simply follow the same format. Keep in mind
this was not designed to save DGROUP, it will COST DGROUP. However it
will allow EASY editing of prompts, that is its main purpose, along with
making BBS softwares like Telegard obsolete. (that hasn't happened
already?)
If you make any enhancements to this mod, feel free to post it on the
Modnet - there's a never ending list of things you can put in here. Its
not limited to prompts either - with alot of variables, its possible,
possible, to put entire functions such as 'Y'our information into a
readprompt(). ie:
readprompt("Your gold: @t");
...and that would be repeated throughout the entire function.
You don't have to use readprompt only on status.xxx variables - it can
read strings directly from the BBS, or even an external strings manager.
ie, for RR5:
prt_string(s,666);
readprompt(s);
or for ESM:
strcpy(s,get_string(666));
readprompt(s);
Don't know about other string managers - I'm not familiar with them. I
don't use any myself.
...and now I shall move on to other mods, and pretty much abandon this one
unless there's a need for it.
Untouchable (1@9804)
The King's Crown - 908/238-4193 at 3/12/24/9600 baud V32.
Auto-Sysop Validation, 22+ Megs WWIV Files, 800+ Mods, PCPursuitable NJNBR.
Other mods by me: SCROLL, SHOWBDAY, CHATCMMD, TIMEMSG, CURTTL, CAPNAME,
FINDSYS, THRUSYS, WORD, CFGLIST, F1VALID, ANSICFG, MINUTES, ANSIFX, and of
course EDPROMPT.